package order.main.ArrayAdapter;

import java.util.List;

import org.util.print.printLogCat;

import xml.xmlTable.XmlTable;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;

public class ArrayAdapterForXmlTable extends ArrayAdapter{
	protected Context mContext=null;
	protected LayoutInflater mInflater=null;
	protected XmlTable list=null;
	public ArrayAdapterForXmlTable(Context c, int textViewResourceId, XmlTable data,String[] x){
		
		super(c, textViewResourceId,x);  
    	 this.mContext=c;
    	 mInflater=LayoutInflater.from(c);
    	 list=data;
     }
	public XmlTable getList() {
		return list;
	}
	public void setList(XmlTable list) {
		this.list = list;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.getMsgSize();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		if(list!=null){
			
		return list.getMsgAt(arg0);
		}else{
		return arg0;
		}
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}
}
